﻿using Mozi.HttpEmbedded.Generic;

namespace Mozi.Live.RTP
{
    // 0    PCMU A            8,000       1
    // 1    reserved A
    // 2    reserved A
    // 3    GSM A             8,000       1
    // 4    G723 A            8,000       1
    // 5    DVI4 A            8,000       1
    // 6    DVI4 A            16,000       1
    // 7    LPC A             8,000       1
    // 8    PCMA A            8,000       1
    // 9    G722 A            8,000       1
    // 10   L16 A             44,100       2
    // 11   L16 A             44,100       1
    // 12   QCELP A           8,000       1
    // 13   CN A            8,000       1
    // 14   MPA A           90,000       (see text)
    // 15   G728 A            8,000       1
    // 16   DVI4 A           11,025       1
    // 17   DVI4 A           22,050       1
    // 18   G729 A            8,000       1
    // 19   reserved A
    // 20   unassigned A
    // 21   unassigned A
    // 22   unassigned A
    // 23   unassigned A
    // dyn G726-40     A            8,000       1
    // dyn G726-32     A            8,000       1
    // dyn G726-24     A            8,000       1
    // dyn G726-16     A            8,000       1
    // dyn G729D       A            8,000       1
    // dyn G729E       A            8,000       1
    // dyn GSM-EFR A            8,000       1
    // dyn L8          A var.var.
    // dyn  RED A                        (see text)
    // dyn  VDVI A            var.        1
    //24      unassigned V
    //25      CelB V           90,000
    //26      JPEG V           90,000
    //27      unassigned V
    //28      nv V           90,000
    //29      unassigned V
    //30      unassigned V
    //31      H261 V           90,000
    //32      MPV V           90,000
    //33      MP2T AV          90,000
    //34      H263 V           90,000
    //35-71   unassigned?
    //72-76   reserved N/A N/A
    //77-95   unassigned?
    //96-127  dynamic?
    //dyn     H263-1998   V           90,000
    public class RTPPayloadType : AbsClassEnum
    {
        public RTPPayloadType PCMU = new RTPPayloadType(0,"audio","PCMU",8000,1);
        public RTPPayloadType H264 = new RTPPayloadType(96, "video", "H264", 90000, 1);
        public RTPPayloadType AAC = new RTPPayloadType(0, "audio", "AAC", 8000, 1);
        // 3    GSM A             8,000       1
        // 4    G723 A            8,000       1
        // 5    DVI4 A            8,000       1
        // 6    DVI4 A            16,000       1
        // 7    LPC A             8,000       1
        // 8    PCMA A            8,000       1
        // 9    G722 A            8,000       1
        // 10   L16 A             44,100       2
        // 11   L16 A             44,100       1
        // 12   QCELP A           8,000       1
        // 13   CN A            8,000       1
        // 14   MPA A           90,000       (see text)
        // 15   G728 A            8,000       1
        // 16   DVI4 A           11,025       1
        // 17   DVI4 A           22,050       1
        // 18   G729 A            8,000       1

        private readonly int payloadType;
        private readonly string category;
        private readonly string typeName;
        private readonly int clockrate;
        private readonly int channels;

        protected override string Tag => payloadType.ToString();

        public RTPPayloadType(int payloadType,string category,string typeName, int clockrate,int channels)
        {
            this.payloadType = payloadType;
            this.category = category;
            this.typeName = typeName;
            this.clockrate = clockrate;
            this.channels = channels;
        }
    }
}
